Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong layout on iPad modal presentation when the view controller frame is changed #254

Merged
merged 1 commit into from
Jul 27, 2020

Conversation

czuria1
Copy link
Contributor

@czuria1 czuria1 commented Jul 22, 2020

Before you make a Pull Request, read the important guidelines:

Issue Link 🔗

  • Is this a bug fix or a feature? Bug fix
  • Does it break any existing functionality? No

Goals of this PR 🎉

  • Why is the change important? A view frame change in the CardsViewController should reflect the latest size in the layout, specifically recalculating the sizing of the cells of the flow layout if the cardCellWidth changes.
  • What does this fix? The collection view layout will recalculate, with an immediate layout pass, upon cardCellWidth changes such as when a CardsViewController is presented as a formSheet on an iPad.
  • How far has it been tested? Manual testing

How Has This Been Tested 🔍

Please let us know if you have tested your PR and if we need to reproduce the issues. Also, please let us know if we need any relevant information for running the tests.

  • User Interface Testing
  • Application Testing

Test Configuration 👾

  • Xcode version: 11.5
  • Device/Simulator: iPad Pro (12.9-inch) (4th generation)
  • iOS version: 13.5 || MacOSX version: 10.15.5

Things to check on 🎯

  • My Pull Request code follows the coding standards and styles of the project
  • I have worked on unit tests and reviewed my code to the best of my ability
  • I have used comments to make other coders understand my code better
  • My changes are good to go without any warnings
  • I have added unit tests both for the happy and sad path
  • All of my unit tests pass successfully before pushing the PR
  • I have made sure all dependent downstream changes impacted by my PR are working

@rcole34
Copy link
Contributor

rcole34 commented Jul 22, 2020

Great clean fix @czuria1! We encountered this issue with CardsViewControllers not readjusting their margins when presented in iPad form sheet modals. I believe this should also fix #242 and possibly #221 as well

@badrinathvm
Copy link
Contributor

badrinathvm commented Jul 22, 2020

@czuria1 Like the usage of distinctUntilChanged() the operator ignores duplicate consecutive emissions.
Looks good to me.
Also on side check Can we make sure this doesn't affect any of the existing things on iPhone ?

@czuria1
Copy link
Contributor Author

czuria1 commented Jul 23, 2020

@badrinathvm Right, it should not affect any current implementation on an iPhone.

Copy link
Contributor

@croossin croossin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the user of distinctUntilChanged .. looks good to me.

@badrinathvm badrinathvm merged commit 14b491c into intuit:master Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants